home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / rockridge / ui / layout / example / CustomEx1.java < prev    next >
Encoding:
Java Source  |  1995-11-13  |  614 b   |  30 lines

  1. import java.awt.*;
  2. import java.applet.Applet;
  3.  
  4. public class CustomEx1 extends Applet {
  5.     public void init() {
  6.     setLayout(new DiagonalLayout());
  7.         setFont(new Font("Helvetica", Font.PLAIN, 14));
  8.    
  9.     add(new Button("Button 1"));
  10.     add(new Button("Button 2"));
  11.     add(new Button("Button 3"));
  12.     add(new Button("Button 4"));
  13.     add(new Button("Button 5"));
  14.  
  15.         resize(199, 145);
  16.     }
  17.  
  18.     public static void main(String args[]) {
  19.     Frame f = new Frame("Custom Layout Example");
  20.     CustomEx1 ex1 = new CustomEx1();
  21.  
  22.     ex1.init();
  23.  
  24.     f.add("Center", ex1);
  25.     f.pack();
  26.     f.resize(f.preferredSize());
  27.     f.show();
  28.     }
  29. }
  30.